/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package polaczenie;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.Statement;
import java.sql.ResultSet;
import java.sql.SQLException;

/**
 *
 * @author Cyga
 */
public class polacz {



	Connection c = null;
	
	public void laczZBD(){
	 try {
	      Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();
	      c = DriverManager.getConnection(
	        "jdbc:oracle:thin:@localhost:1521:orcl","user", "12345");
	      System.out.println ("Uda�o si� po��czy� z baz� danych...");
	    } catch (ClassNotFoundException e) {
	      System.out.println ("Problem z driverem bazy danych...");
	    } catch (SQLException e) {
	        System.out.println ("Nie mo�na po��czy� si� z baza danych...");
	    } catch (Exception e) {
	        System.out.println ("B��d przy po��czeniu z baz� danych...");
	    }
	}
      
}

